//
//  BaseViewModel.m
//  ManBetX
//
//  Created by Cocoa on 2020/4/10.
//  Copyright © 2020 Fullen. All rights reserved.
//

#import "BaseViewModel.h"

@interface BaseViewModel ()

@property (strong, readwrite, nonatomic) id entity;
@property (assign, readwrite, getter=isEmpty, nonatomic) BOOL empty;

@end

@implementation BaseViewModel

+ (instancetype)viewModelWithEntity:(id)entity {
    return [[[self class] alloc] initWithEntity:entity];
}

- (instancetype)initWithEntity:(id)entity {
    self = [super init];
    if (self) {
        self.entity = entity;
    }
    return self;
}

+ (instancetype)initEmpty {
    BaseViewModel *vm = [[[self class] alloc] init];
    vm.empty = YES;
    [vm create];
    
    return vm;
}

- (void)create {
    /**
     * 子类需要重写
     */
}

- (CGFloat)cellHeight {
    /**
     * 子类需要重写
     */
    return 3.0;
}

- (CGSize)cellSize {
    /**
     * 子类需要重写
     */
    
    return CGSizeZero;
}
@end
